Skip to content

One time AddressableEntity migration at protocol upgrade - #5433

Open
darthsiroftardis wants to merge 14 commits into
casper-network:feat-evmfrom
darthsiroftardis:one-time-ae-conversion
Open

One time AddressableEntity migration at protocol upgrade#5433
darthsiroftardis wants to merge 14 commits into
casper-network:feat-evmfrom
darthsiroftardis:one-time-ae-conversion

Conversation

@darthsiroftardis

Copy link
Copy Markdown
Contributor

CHANGELOG:

  • Changed protocol upgrade logic to perform a one time migration of accounts and contracts to AE
  • Changed protocol upgrade logic to write the enable_addressable_entity_flag to global state during the upgrade

}

if self.engine_config.enable_entity {
println!("in ae flow");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

printy print print

fn setup() -> LmdbWasmTestBuilder {
let mut builder = LmdbWasmTestBuilder::default();
builder.run_genesis(LOCAL_GENESIS_REQUEST.clone());
// let mut builder = LmdbWasmTestBuilder::default();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this commented code needed?

let res = contract_runtime
.data_access_layer()
.entry_point_exists(request);
println!("{:?}", res);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print

for account_key in hash_keys.iter() {
if let Ok(Some(StoredValue::ContractPackage(_))) = self.tracking_copy.read(account_key)
{
println!("migrating {account_key}");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print

debug!("successfully migrated package")
}
Err(tc_error) => {
error!("unable to migrate package {}", tc_error)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should fail the whole upgrade procedure at this point

debug!("successfully migrated account {}", account_hash)
}
Err(tc_error) => {
error!("failed to migrate userland account {}", tc_error)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should fail the upgrade procedure at this point?

@zajko zajko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAl at the comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants